<?php
$allCategory = $this->allCategory;
$objCat = new Category();
?>

<style>
#leftmenu ul li.level2 {
    margin-left:10px;
}
</style>
<!--[if IE]>
<style type="text/css">
#searchBox { padding:3px 5px 0 5px; height:19px; }
#newsletter #email { padding:3px 3px 0 3px; height:21px; }
</style>
<![endif]-->
<!--[if lte IE 7]>
<style type="text/css">
#welcome { margin:0 10px 0 15px; }
#right { margin:0; }
</style>
<![endif]-->
<script type="text/javascript" language="javascript">
function clearText(field){
    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;

}
</script>

                        <td id="left"> <!-- must have tag td in this file, just change content of this tag-->
                            <!-- start left menu-->
                            <div id="leftmenu">
                                <img alt="Shop skincare products By Brand" src="<?php echo JS_PATH?>/skincarebyalana/images/shopByBrand.png"/>
                                
                                <!-- form -->
                                <div style="padding: 10px 0px">
                                    <select id="brandDD"name="category" style="width: 130px; display: inline;" onchange="document.location.href = this.options[this.options.selectedIndex].value;">
                                        <option value="">select a brand</option>
                                        <?php
                                        foreach($allCategory as $row):
                                            if ($row['left'] != 1 && ($row['level'] == 1)) {
                                        ?>
                                        <option value="<?php echo $objCat->url($row) ?>"><?php echo $row['admin_title']?></option>
                                        <?php
                                            }
                                        endforeach;
                                        ?>
                                    </select>
                                </div>
                                <!-- end form-->


                                <ul id="menu-left"  class="menu">
<?php

//$this->view->currentPage


//$currentPage = $this->leftMenuID;

$currentPage = $this->currentPageID;
if($this->leftMenuID)
    $currentPage = $this->leftMenuID;

if ($currentPage > 0) {
?>
<?php
    // get all category has assigned from indexAction.
    

    // get current node
    $leftMenu = $allCategory[$currentPage];
    $homepage = true;
    if (isset($leftMenu['children']) && count($leftMenu['children']) > 0) {
        if (($leftMenu['left'] != 1)) { // check current category not root and only FeaturedCategory = 1
        $homepage = false;
    ?>
            <li class="level<?=$leftMenu['level']?>"><a class="<?=$class?>" href="<?php echo $objCat->url($leftMenu) ?>"><?php echo $leftMenu['admin_title'];?></a></li>
    <?php
        }
        //echo "<div class='blocktitle'><h3>" . $leftMenu['admin_title'] . "</h3></div>";
        //echo "<div style='padding: 10px'>";
        foreach($leftMenu['children'] as $item):
            $class = "";
            $row = $allCategory[$item];
                if (($row['status'] == 1) && ((($row['FeaturedCategory'] == 1) && $homepage) || !$homepage )) {
                if ($this->currentPageID == $item) {
                    $class = " active";
                }
        ?>
                <li class="level<?=$row['level']?>"><a class="<?=$class?>" href="<?php echo $objCat->url($row) ?>"><?php echo $row['admin_title'];?></a></li>
                <?php
                }
        endforeach;
        //echo "<div style='clear:both;'></div>";
        //echo "</div>";
    } // count left children
?>

<?php } // if currentPage?>
                                </ul>
                            </div> <!-- end left menu-->
                            <div style="clear:both">
                            </div>
                            <div style="padding:20px 0px">
                                <?php
                                @$concern = $allCategory[135];
                                if ($concern) {
                                    @$children = $concern['children'];
                                    if (count($children) > 0) {
                                ?>
                                <div id="searchconcern">
                                    <div style="text-align:center;padding-top:40px">
                                        <select  style="width: 130px; display: inline;" onchange="document.location.href = this.options[this.options.selectedIndex].value;">
                                            <option value="">---select---</option>
                                        <?php
                                        foreach($children as $child):
                                            $row = $allCategory[$child];
                                        ?>
                                            <option value="<?php echo $objCat->url($row) ?>"><?php echo $row['admin_title'] ?></option>
                                        <?php
                                        endforeach;
                                        ?>
                                        </select>
                                    </div>
                                </div>
                                <?php
                                    }
                                }
                                ?>
                                <?php
                                @$concern = $allCategory[96];
                                if ($concern) {
                                    @$children = $concern['children'];
                                    if (count($children) > 0) {
                                ?>
                                <div style="padding-top:20px">
                                </div>
                                <div id="searchcategory">
                                    <div style="text-align:center;padding-top:40px">
                                        <select  style="width: 130px; display: inline;" onchange="document.location.href = this.options[this.options.selectedIndex].value;">
                                            <option value="">---select---</option>
                                        <?php
                                        foreach($children as $child):
                                            $row = $allCategory[$child];
                                        ?>
                                            <option value="<?php echo $objCat->url($row) ?>"><?php echo $row['admin_title'] ?></option>
                                        <?php
                                        endforeach;
                                        ?>
                                        </select>
                                    </div>
                                </div>
                                <?php
                                    }
                                }
                                ?>
                                
                                <div id="newsletterSmall">

            <form name="ccoptin" action="http://visitor.constantcontact.com/d.jsp" target="_blank" method="post" style="margin-bottom:2;" title="sign up for free deals on skincare products">
            
            <input type="hidden" name="m" value="1101968623761" />
            
            <input type="hidden" name="p" value="oi" />
            
            <center>
            
            <table cellpadding="0" cellspacing="0" border="0" align="center" width="100%">
            
            <tr>
            
            <td align="center"><img src="<?php echo JS_PATH?>/skincarebyalana/images/signup_left.png" alt="Signup for our Newsletter" /></td>
            
            </tr>
            
            <tr>
            
            <td align="center"><input type="text" name="ea" id="emailSmall" value="-- enter email --" onFocus ="clearText(this)" onBlur="clearText(this)"  /></td>
            
            </tr>
            
            <tr><td height="10"></td></tr>
            
            <tr>
            
            <td align="right"><input type="submit" value=" " name="go" id="submit" /></td>
            
            </tr>
            
            <tr>
            
            <td align="left"><img src="<?php echo JS_PATH?>/skincarebyalana/images/safesubscribe_left.jpg" alt="" /></td>
            
            </tr>
            
            </table>
            
            </center>
            
            </form>

</div><!-- END NEWSLETTERSMALL -->
                            </div>
                        </td> <!-- must have tag td in this file-->
                        
                        
